package com.randi.system.domain.entity.sysNotice;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@ApiModel(value = "SysNoticeRead", description = "通告读取对象")
public class SysNoticeRead implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "read_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "读取ID")
    private Long readId;

    @TableField(value = "`notice_id`")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "通告ID")
    private Long noticeId;

    @TableField(value = "`user_id`")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @TableField(value = "`create_time`")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "读取时间")
    private Date createTime;

    public SysNoticeRead(Long noticeId, Long userId) {
        this.noticeId = noticeId;
        this.userId = userId;
    }

}
